package com.hwy.struts.demo02;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.Test;

import com.hwy.struts.domain.Customer;
import com.hwy.struts.utils.HibernateUtil;

public class TestHibernate {
	public static void main(String[] args) {
		Session currentSession = HibernateUtil.getCurrentSession();
		
		Transaction beginTransaction = currentSession.beginTransaction();
		
		String id = "8";
		Long cust_id = Long.parseLong(id);
		System.out.println(cust_id);
		Customer customer = currentSession.get(Customer.class,cust_id);
		
		System.out.println(customer);
		
		beginTransaction.commit();
	}

}
